﻿using Cl.Model.Results;
using Cl.Service.Service.User.Departments;
using Cl.WebApi.Controllers;
using Cl.WebApi.SwaggerModel;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Cl.WebApi.Areas.Admin.Users
{
    /// <summary>
    /// 部门管理
    /// </summary>
    [Route("api/[controller]/[action]")]
    [ApiController]
    [ApiExplorerSettings(GroupName = Grouping.AdminGroup)]
    public class DepartmentController : BaseController
    {

        private IDepartmentService _departmentService;

        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="departmentService"></param>
        public DepartmentController(IDepartmentService departmentService)
        {

            _departmentService = departmentService;
        }

        /// <summary>
        /// 获取部门列表
        /// </summary>
        /// <returns></returns>
        [HttpGet]
        public ResultInfoModel GetDepartmentList()
        {
            var data = _departmentService.GetDepartmentList();
            return GetResult.Success("Success", data);

        }
    }
}
